<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    
    <title>充值卡新增</title>
   <link href="${ctx}/style/style.css" rel="stylesheet" type="text/css" />
   <link type="text/css" rel="stylesheet"
			href="${ctx}/style/formValidataor/formValidator.css" />
	<script language="JavaScript" src="${ctx}/scripts/jquery.js"></script>
	<script type="text/javascript"
			src="${ctx}/scripts/formValidataor/formValidator.js"></script>
	<script type="text/javascript"
		src="${ctx}/scripts/formValidataor/formValidatorRegex.js"></script>
	<script type="text/javascript"
			src="${ctx}/scripts/lhgdialog/lhgdialog.js"></script>		
	<script type="text/javascript">
		$(document).ready(function(){
			$.formValidator.initConfig();
			$("#cardnumber").formValidator({onshow:"请输入生成数量",
		        onfocus:"请输入生成数量",oncorrect:"生成数量输入正确"})
		        .regexValidator({regexp:"intege1",datatype:"enum",onerror:"生成数量只能是整数"});  
		    $("#cardmoney").formValidator({onshow:"请输入单卡金额",
		        onfocus:"请输入单卡金额",oncorrect:"单卡金额输入正确"})
		        .regexValidator({regexp:"intege1",datatype:"enum",onerror:"单卡金额只能是整数"});  
		});
		function setContMoney(){
			var cardnumber = $("#cardnumber").val();
			var cardmoney = $("#cardmoney").val();
			if(cardnumber != '' && cardmoney != '' && !isNaN(cardnumber) && !isNaN(cardmoney)){
				$("#contMoney").val(parseInt(cardnumber) * parseInt(cardmoney));
			}
		}
	</script>
 </head>
 <body>
   	<form id="myform" name="myform"  action=""  method="post" >
	    <table class="dataTable" cellpadding="0" cellspacing="0" width="400" height="150">
			<tr>
				<td align="right">生成数量:</td>
				<td><input  id="cardnumber" class="input" onblur="setContMoney()"/></td>
				<td><div id="cardnumberTip"></div></td>
			</tr> 
			<tr>
				<td align="right">单卡金额:</td>
				<td><input  id="cardmoney" class="input" onblur="setContMoney()"/></td>
				<td><div id="cardmoneyTip"></div></td>
			</tr>   
			<tr>
				<td align="right">总结金额:</td>
				<td colspan="2"><input id="contMoney" class="input" readonly="true"/></td>
			</tr>
	    </table>
	  </form> 
  </body>
</html>
